#pragma once
#include <EventManager.h>
#include <addons\ScreenQuad.h>

class BackgroundAction : public ds::Action , public ds::EventHandler {

public:
	BackgroundAction() : ds::Action("UpdateBackground") , m_Fading(false) , m_Timer(0.0f) , m_FadeTimer(0.0f) {
		gEngine->getEventManager().registerEventHandler(this);
		m_ShaderHandle = gEngine->getResourceManager().findByName("Background",ds::RS_SHADER);		
		m_StripesHandle = gEngine->getResourceManager().findByName("Circle",ds::RS_SHADER);
	}
	~BackgroundAction() {}
	void start() {
		setActive(true);
	}
	void stop() {
		setActive(false);
	}
	void update( float elapsed );
	void process( ds::EventBuffer& buffer );
private:
	ds::ResourceHandle m_ShaderHandle;
	ds::ResourceHandle m_StripesHandle;
	float m_Timer;
	bool m_Fading;
	float m_FadeTimer;	
};

